package com.wa.pojo;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.wa.annotation.AllchipsLogEntityId;
import com.wa.annotation.AllchipsLogEntityName;
import com.wa.annotation.AllchipsLogProperty;
import com.wa.annotation.AllchipsLogRelationObject;
import com.wa.page.BaseLogEntity;

import java.util.Date;
import java.util.List;

/**
 * @author tianfeng

 * @date 2017-07-08 22:50:05
 */
@JsonInclude(JsonInclude.Include.NON_NULL)
public class User extends BaseLogEntity {

    /**
	 *
	 */
	private static final long serialVersionUID = 1L;

	/**
	 * 关联的人员工号
	 */
	private String employeeNumber;

	/**
	 * 关联的人员ID
	 */
	private Long employeeId;

	/**
	 * 人员信息的部门名称
	 */
	private String department;

	/**
	 * 人员信息的部门ID
	 */
	private Integer departmentId;

	/**
	 * 关联状态 10未关联  20已关联
	 */
	private Integer relevanceStatus;

	/**
	 * 用户id
	 */
	@AllchipsLogEntityId
	@AllchipsLogProperty(name = "用户id")
	private Integer userId;
	/**
	 * 账号邮箱
	 */
	@AllchipsLogProperty(name = "用户邮箱")
	private String email;

	/**
	 * 用户名（英文名）
	 */
	@AllchipsLogEntityName
	@AllchipsLogProperty(name = "用户名（英文名）")
	private String userName;

	/**
	 * 昵称(中文名)
	 */
	@AllchipsLogProperty(name = "用户名（中文名）")
	private String nickName;

	/**
	 * 用户状态 0-启用中，1-已禁用
	 */
	private Integer managerStatus;

	/**
	 * 用户状态
	 */
	@AllchipsLogProperty(name = "账号状态")
//	@NotEntityFiled
	private String managerStatusDesc;

	/**
	 * 密码
	 */
	private String password;
	/**
	 * 密码确认，临时变量
	 */
	private String conPassword;
	/**
	 * 原密码，临时变量
	 */
	private String oldPassword;
	/**
	 * 盐
	 */
	private String salt;
	/**
	 * 登录用户的密码
	 */
//	@NotEntityFiled
	private String loginUserPassword;

	/**
	 * 角色roleId（查询时用）
	 */
	private Integer roleId;
	/**
	 * 角色roleIds（返回结果时用）
	 */
	private String roleIds;
	/**
	 * 角色id列表
	 */
//	@NotEntityFiled
	private List<Integer> roleIdList;
	/**
	 * 角色roleNames（返回结果时用）
	 */
	private String roleNames;
	/**
	 * 角色列表（返回结果时用）
	 */
	@AllchipsLogRelationObject(name = "角色列表")
//	private List<Role> roleList;
	/**
	 * 用户组groupId (查询时用）
	 */
	private Integer groupId;
	/**
	 * 用户组groupIds(返回结果时用）
	 */
	private String groupIds;
	/**
	 * 用户组groupNames(返回结果时用）
	 */
	private String groupNames;
	/**
	 * 部门权限id (查询时用）
	 */
	private Integer deptId;
	/**
	 * 部门权限id (返回结果时用）
	 */
	private String deptIds;
	/**
	 * 部门权限Names (返回结果时用）
	 */
	private String deptNames;
    /**
     * 权限(,分割)
     */
    private String permissionIds;

	/**
     * 手机号
     */
    private String mobile;

    /**
     * 头像
     */
    private String headerUrl;
	/**
	 * 用户头像
	 */
//	@NotEntityFiled
//	private FileUploadPojo headUrl;

    /**
     * 签名
     */
    private String signature;

    /**
     * 性别
     */
    private String gender;

    /**
     * 生日
     */
    private Date birthday;

	/**
	 * 职业
	 */
	private String job;
	/**
	 * 传真
	 */
	private String fax;
	/**
	 * 传真分机号
	 */
	private String faxExt;

	/**
	 * 座机号
	 */
	private String phone;

	/**
	 * 区号
	 */
	private String phoneExt;
	/**
	 * qq
	 * @return
	 */
	private String qq;

	/**
	 * 身份标识：10销售；20采购(兼容保留已废弃字段，不建议使用)
	 */
//	@NotEntityFiled
	private Integer identifyLabel;

	/**
	 * 多身份标识：10销售;20采购;30跟单;40商务(可以多个身份以,分隔)
	 */
	private String multipleIdentifyLabel;

	/**
	 * 多身份标识名称：10销售;20采购;30跟单;40商务(可以多个身份以,分隔)
	 */
	@AllchipsLogProperty(name = "身份")
//	@NotEntityFiled
	private String multipleIdentifyLabelName;

	/**
	 * 开始时间,临时变量
	 */
	private String beginTime;

	/**
	 * 结束时间，临时变量
	 */
	private String endTime;

	/**
	 * 修改人Id
	 */
	private Integer updateUserId;

	/**
	 * 修改人名字
	 */
	private String updateUserName;

	/**
	 * 修改时间
	 */
	private Date updateTime;

	/**
	 * 创建人Id
	 */
	private Integer createUserId;

	/**
	 * 创建人名字
	 */
	private String createUserName;

	/**
	 * 注册时间
	 */
	private Date registerTime;

	/**
	 * 注册id
	 */
	private String registerIp;

	/**
	 * 登录Ip
	 */
//	@NotEntityFiled
	private String loginIp;

	/**
	 * 最后登录时间
	 */
	private Date lastLoginTime;

	/**
	 * 人员信息的部门ID列表
	 */
//	@NotEntityFiled
	private List<Integer> departmentIdList;

	/**
	 * 权限部门ID列表
	 */
//	@NotEntityFiled
	private List<Integer> deptIdList;

	/**
	 * 身份标签集合
	 */
//	@NotEntityFiled
	private List<Integer> identifyLabelList;

	/**
	 * 通过用户ID批量查询
	 */
//	@NotEntityFiled
	private List<Integer> userIdList;

	/**
	 * 人员信息所属部门的身份
	 */
	private String deptIdentifyLabel;

	/**
	 * 最大联系人数限制
	 */
	private Integer maxFollowContactsNums;

	/**
	 * 最大客户数限制
	 */
	private Integer maxFollowCustomerNums;

	/**
	 * 登录标识 10:知识库登陆
	 */
//	@NotEntityFiled
	private Integer loginFlag;

	/**
	 * 账号邮箱
	 */
	private List<String> emailList;

	/**
	 * 用户账户设置标识：10账户设置(即用户个人修改BOSS账户信息)
	 */
	private Integer userSettingFlag;

	/**
	 * 通用是否已存在标识
	 */
	private boolean exist;
	/**
	 * 第三方授权用户
	 */
	@AllchipsLogRelationObject
//	private UserOauth userOauth;

	/**
	 * 绑定状态：10-未解绑，20-已解绑
	 */
	private Integer userOauthBindFlag;

	/**
	 * 密码状态：10 需手动修改密码； 20 无需修改密码；
	 */
	private Integer pwdStatus;

	/**
	 * 邮箱验证码；
	 */
	private String authCode;

	/**
	 * 部门列表；
	 */
//	@NotEntityFiled
	private Object deptList;

//	public List<Dept> getDeptListExt() {
//		return deptListExt;
//	}
//
//	public void setDeptListExt(List<Dept> deptListExt) {
//		this.deptListExt = deptListExt;
//	}

	/**
	 * 部门列表扩展（）；
	 */
//	@NotEntityFiled
//	private List<Dept> deptListExt;

	public Object getDeptList() {
		return deptList;
	}

	public void setDeptList(Object deptList) {
		this.deptList = deptList;
	}


	public String getAuthCode() {
		return authCode;
	}

	public void setAuthCode(String authCode) {
		this.authCode = authCode;
	}

	public Long getEmployeeId() { return employeeId; }

	public void setEmployeeId(Long employeeId) { this.employeeId = employeeId; }

	public String getRoleNames() { return roleNames; }

	public void setRoleNames(String roleNames) { this.roleNames = roleNames; }

	public String getGroupNames() { return groupNames; }

	public void setGroupNames(String groupNames) { this.groupNames = groupNames; }

	public String getDeptNames() { return deptNames; }

	public void setDeptNames(String deptNames) { this.deptNames = deptNames; }

	public String getRoleIds() { return roleIds; }

	public void setRoleIds(String roleIds) { this.roleIds = roleIds; }

	public List<Integer> getRoleIdList() {
		return roleIdList;
	}

	public void setRoleIdList(List<Integer> roleIdList) {
		this.roleIdList = roleIdList;
	}

	public String getGroupIds() { return groupIds; }

	public void setGroupIds(String groupIds) { this.groupIds = groupIds; }

	public String getDeptIds() { return deptIds; }

	public void setDeptIds(String deptIds) { this.deptIds = deptIds; }

	public String getDepartment() {
		return department;
	}

	public void setDepartment(String department) {
		this.department = department;
	}

	public Integer getDepartmentId() {
		return departmentId;
	}

	public void setDepartmentId(Integer departmentId) {
		this.departmentId = departmentId;
	}

	public Integer getRelevanceStatus() {
		return relevanceStatus;
	}

	public void setRelevanceStatus(Integer relevanceStatus) {
		this.relevanceStatus = relevanceStatus;
	}

	public Integer getUpdateUserId() {
		return updateUserId;
	}

	public void setUpdateUserId(Integer updateUserId) {
		this.updateUserId = updateUserId;
	}

	public String getUpdateUserName() {
		return updateUserName;
	}

	public void setUpdateUserName(String updateUserName) {
		this.updateUserName = updateUserName;
	}

	public Integer getCreateUserId() {
		return createUserId;
	}

	public void setCreateUserId(Integer createUserId) {
		this.createUserId = createUserId;
	}

	public String getCreateUserName() {
		return createUserName;
	}

	public void setCreateUserName(String createUserName) {
		this.createUserName = createUserName;
	}

	public String getLoginIp() {
		return loginIp;
	}

	public void setLoginIp(String loginIp) {
		this.loginIp = loginIp;
	}

	public String getLoginUserPassword() { return loginUserPassword; }

	public void setLoginUserPassword(String loginUserPassword) {
		this.loginUserPassword = loginUserPassword;
	}

	public Integer getUserId() { return userId; }

	public Integer getRoleId() { return roleId; }

	public void setRoleId(Integer roleId) { this.roleId = roleId; }

	public String getPermissionIds() {
		return permissionIds;
	}

	public void setPermissionIds(String permissionIds) {
		this.permissionIds = permissionIds;
	}

	public void setUserId(Integer userId) {
		this.userId = userId;
	}

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public String getMobile() {
		return mobile;
	}

	public void setMobile(String mobile) {
		this.mobile = mobile;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getSalt() {
		return salt;
	}

	public void setSalt(String salt) {
		this.salt = salt;
	}

	public String getNickName() {
		return nickName;
	}

	public void setNickName(String nickName) {
		this.nickName = nickName;
	}

	public String getHeaderUrl() {
		return headerUrl;
	}

	public void setHeaderUrl(String headerUrl) {
		this.headerUrl = headerUrl;
	}

	public String getSignature() {
		return signature;
	}

	public void setSignature(String signature) {
		this.signature = signature;
	}

	public String getGender() {
		return gender;
	}

	public void setGender(String gender) {
		this.gender = gender;
	}

	public Date getBirthday() {
		return birthday;
	}

	public void setBirthday(Date birthday) {
		this.birthday = birthday;
	}

	public String getRegisterIp() {
		return registerIp;
	}

	public void setRegisterIp(String registerIp) {
		this.registerIp = registerIp;
	}

	public Date getRegisterTime() {
		return registerTime;
	}

	public void setRegisterTime(Date registerTime) {
		this.registerTime = registerTime;
	}

	public Date getLastLoginTime() {
		return lastLoginTime;
	}

	public void setLastLoginTime(Date lastLoginTime) {
		this.lastLoginTime = lastLoginTime;
	}

	public Date getUpdateTime() {
		return updateTime;
	}

	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}

	public Integer getManagerStatus() {
		return managerStatus;
	}

	public void setManagerStatus(Integer managerStatus) {
		this.managerStatus = managerStatus;

		if (managerStatus == null) {
			managerStatusDesc = null;
			return;
		}
//		UserStatusEnum userStatusEnum = UserStatusEnum.get(managerStatus);
//		if (userStatusEnum == null) {
//			managerStatusDesc = null;
//			return;
//		}
//		managerStatusDesc = userStatusEnum.getStatusMsgCn();
	}

	public String getJob() {
		return job;
	}

	public void setJob(String job) {
		this.job = job;
	}

	public String getFax() {
		return fax;
	}

	public void setFax(String fax) {
		this.fax = fax;
	}

	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	public String getPhoneExt() {
		return phoneExt;
	}

	public void setPhoneExt(String phoneExt) {
		this.phoneExt = phoneExt;
	}

	public String getQq() {
		return qq;
	}

	public void setQq(String qq) {
		this.qq = qq;
	}

	public Integer getIdentifyLabel() {
		return identifyLabel;
	}

	public void setIdentifyLabel(Integer identifyLabel) {
		this.identifyLabel = identifyLabel;
	}

	public String getMultipleIdentifyLabel() {
		return multipleIdentifyLabel;
	}

//	public void setMultipleIdentifyLabel(String multipleIdentifyLabel) {
//		this.multipleIdentifyLabel = multipleIdentifyLabel;
//
//
//		if (multipleIdentifyLabel == null) {
//			multipleIdentifyLabelName = null;
//			return;
//		}
//		if (CommUtils.isEmpty(multipleIdentifyLabel)) {
//			multipleIdentifyLabelName = "";
//			return;
//		}
//		String[] multipleIdentifyLabelArray = multipleIdentifyLabel.split(",");
//		String[] multipleIdentifyLabelNameArray = new String[multipleIdentifyLabelArray.length];
//		for (int i = 0; i < multipleIdentifyLabelArray.length; i++) {
//			IdentifyLabelEnum identifyLabelEnum = IdentifyLabelEnum.get(CommUtils.toInt(multipleIdentifyLabelArray[i]));
//			if (identifyLabelEnum == null) {
//				continue;
//			}
//			multipleIdentifyLabelNameArray[i] = identifyLabelEnum.getDescCn();
//		}
//
//		multipleIdentifyLabelName = StringUtils.join(multipleIdentifyLabelNameArray, ",");
//	}

	public String getConPassword() {
		return conPassword;
	}

	public void setConPassword(String conPassword) {
		this.conPassword = conPassword;
	}

	public String getBeginTime() {
		return beginTime;
	}

	public void setBeginTime(String beginTime) {
		this.beginTime = beginTime;
	}

	public String getEndTime() {
		return endTime;
	}

	public void setEndTime(String endTime) {
		this.endTime = endTime;
	}

	public String getOldPassword() {
		return oldPassword;
	}

	public void setOldPassword(String oldPassword) {
		this.oldPassword = oldPassword;
	}

	public String getFaxExt() {
		return faxExt;
	}

	public void setFaxExt(String faxExt) {
		this.faxExt = faxExt;
	}

	public String getEmployeeNumber() {
		return employeeNumber;
	}

	public void setEmployeeNumber(String employeeNumber) {
		this.employeeNumber = employeeNumber;
	}

	public Integer getDeptId() { return deptId; }

	public void setDeptId(Integer deptId) { this.deptId = deptId; }

	/*用户集合*/
	public Integer getGroupId() { return groupId; }

	public void setGroupId(Integer groupId) { this.groupId = groupId; }

//	public FileUploadPojo getHeadUrl() {
//		return headUrl;
//	}
//
//	public void setHeadUrl(FileUploadPojo headUrl) {
//		this.headUrl = headUrl;
//	}

	public List<Integer> getDepartmentIdList() { return departmentIdList; }

	public void setDepartmentIdList(List<Integer> departmentIdList) { this.departmentIdList = departmentIdList; }

	public List<Integer> getDeptIdList() { return deptIdList; }

	public void setDeptIdList(List<Integer> deptIdList) { this.deptIdList = deptIdList; }

	public List<Integer> getIdentifyLabelList() {
		return identifyLabelList;
	}

	public void setIdentifyLabelList(List<Integer> identifyLabelList) {
		this.identifyLabelList = identifyLabelList;
	}

	public String getDeptIdentifyLabel() {
		return deptIdentifyLabel;
	}

	public void setDeptIdentifyLabel(String deptIdentifyLabel) {
		this.deptIdentifyLabel = deptIdentifyLabel;
	}

	public List<Integer> getUserIdList() { return userIdList; }

	public void setUserIdList(List<Integer> userIdList) { this.userIdList = userIdList; }

	public Integer getMaxFollowContactsNums() { return maxFollowContactsNums; }

	public void setMaxFollowContactsNums(Integer maxFollowContactsNums) { this.maxFollowContactsNums = maxFollowContactsNums; }

	public Integer getMaxFollowCustomerNums() { return maxFollowCustomerNums; }

	public void setMaxFollowCustomerNums(Integer maxFollowCustomerNums) { this.maxFollowCustomerNums = maxFollowCustomerNums; }

//	public List<Role> getRoleList() {
//		return roleList;
//	}
//
//	public void setRoleList(List<Role> roleList) {
//		this.roleList = roleList;
//	}

	public Integer getLoginFlag() {
		return loginFlag;
	}

	public void setLoginFlag(Integer loginFlag) {
		this.loginFlag = loginFlag;
	}

	public List<String> getEmailList() {
		return emailList;
	}

	public void setEmailList(List<String> emailList) {
		this.emailList = emailList;
	}

	public Integer getUserSettingFlag() {
		return userSettingFlag;
	}

	public void setUserSettingFlag(Integer userSettingFlag) {
		this.userSettingFlag = userSettingFlag;
	}

	public boolean isExist() {
		return exist;
	}

	public void setExist(boolean exist) {
		this.exist = exist;
	}

//	public UserOauth getUserOauth() {
//		return userOauth;
//	}
//
//	public void setUserOauth(UserOauth userOauth) {
//		this.userOauth = userOauth;
//	}

	public Integer getUserOauthBindFlag() {
		return userOauthBindFlag;
	}

	public void setUserOauthBindFlag(Integer userOauthBindFlag) {
		this.userOauthBindFlag = userOauthBindFlag;
	}

	public Integer getPwdStatus() {
		return pwdStatus;
	}

	public void setPwdStatus(Integer pwdStatus) {
		this.pwdStatus = pwdStatus;
	}

	public String getManagerStatusDesc() {
		return managerStatusDesc;
	}

	public void setManagerStatusDesc(String managerStatusDesc) {
		this.managerStatusDesc = managerStatusDesc;
	}

	public String getMultipleIdentifyLabelName() {
		return multipleIdentifyLabelName;
	}

	public void setMultipleIdentifyLabelName(String multipleIdentifyLabelName) {
		this.multipleIdentifyLabelName = multipleIdentifyLabelName;
	}
}
